__author__ = 'East'

# 类继承

# class People:     # 经典类
class People(object):   # 新式类
    def __init__(self, name, age):
        self.name = name
        self.age = age
    def eat(self):
        print('%s is eating...' % self.name)
    def sleep(self):
        print('%s is sleeping...' % self.name)
    def talk(self):
        print('%s is talking...' % self.name)
class Relation(object):
    def __init__(self):
        print(self.name)

    def make_friends(self, obj):
        print('%s is making friends with %s' % (self.name, obj.name ))
class Man(People, Relation):
    def __init__(self, name, age, money):
        # People.__init__(self, name, age)  经典类
        super(Man, self).__init__(name, age)    # 新式类
        self.money = money
        print('money is %s...' % self.money)
    def piao(self):
        print('%s is piaoing...' % self.name)
    def sleep(self):
        People.sleep(self)
        print('man is sleeping...' % self.name)
class Woman(People, Relation):
    def get_birth(self):
        print('%s is born a baby...' % self.name)


m1 = Man('NiuHanyang', 23, 10)
m1.eat()
m1.piao()

w1 = Woman('ChenRonghua', 26)
m1.make_friends(w1)

'''
继承
    python2经典类是按照深度优先来继承的，新式类是按照广度优先来继承的
    python3经典类和新式类都是统一按广度优先来继承的
'''